package org.zhb.sys.shiro.user.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import org.zhb.sys.shiro.model.User;

public interface UserRepository extends JpaRepository<User, String>, JpaSpecificationExecutor<User> {
	User findByUserName(String userName);

	User findByPhone(String phone);

	User findByEmail(String email);

	@Modifying
	@Query(value = "update User u set u.password=?1 where u.userName=?2")
	void updatePasswordByUserName(String password, String userName);
}